<!--_meta 作为公共模版分离出去-->
{include file="public/meta"}
<!--/meta 作为公共模版分离出去-->
<title>修改活动</title>
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="__PUBLIC__/css/datePicker.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/codebase/GooCalendar.css"/>
<script type="text/javascript" src="__PUB__/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript">
function toBase64(file, fun) {
        //参数file为input获取到的file数组第一项，fun向外传递转换成功的base64编码
        var reader = new FileReader();
        if (file) {
            reader.readAsDataURL(file);
            reader.onload = function () {
                fun(this.result);
            }
        }
    }

</script>
</head>
<body>
<div class="page-container">
    <form action="{:url('activity/save_activity')}" method="post" enctype="multipart/form-data" class="form form-horizontal" id="form-article-add">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>活动名称：</label>
            <div class="formControls col-xs-4 col-sm-5">
                <input type="text" class="input-text" value="{$activity.name}" placeholder="" id="" name="name">
                <input type="text" class="input-text" value="{$activity.id}" placeholder="" id="" name="id"  hidden="hidden">

            </div>
        </div>
         <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">活动金额：</label>
            <div class="formControls col-xs-4 col-sm-5">
                <input type="text" class="input-text" value="{$activity.price}" placeholder="" id="price" name="price">
            </div>
        </div>
       <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>活动图片：</label>
            <div class="formControls col-xs-4 col-sm-5">
                <label class="upload_lable" for="file_img"><img id="goodsThums" src="{$activity.goodsThums}"/></label>
                <input type="file" name="img" id="file_img" value="" hidden="hidden"/>
            </div>
        </div>
         <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">活动开始时间：</label>
            <div class="formControls col-xs-4 col-sm-5">
               <input type="text" name="time_from"  placeholder="" value="{$activity.time_from}" class="input-text" id="datepicker" />
            </div>
        </div>
         <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">活动结束时间：</label>
            <div class="formControls col-xs-4 col-sm-5">
               <input type="text" name="time_to"  placeholder="" value="{$activity.time_to}" class="input-text" id="datepick" />
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">报名截止时间：</label>
            <div class="formControls col-xs-4 col-sm-5">
                <input type="text" name="upTo_time" placeholder="" value="{$activity.upTo_time}" class="input-text" id="calen2"/>
            </div>
        </div>  
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">活动地点</label>
            <div class="formControls col-xs-4 col-sm-5">
                <input type="text" name="" id="" placeholder="" value="{$activity.cityName}" class="input-text">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">活动特色：</label>
            <div class="formControls col-xs-4 col-sm-5">
                <textarea name="activityDesc" cols="" rows="" class="textarea"  placeholder="说点什么..." dragonfly="true" onKeyUp="textarealength(this,100)">{$activity.activityDesc}</textarea>
                <p class="textarea-numberbar"></p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">活动细节：</label>
            <div class="formControls col-xs-4 col-sm-5">
                <textarea name="activityDetail" cols="90" rows="10"   placeholder="说点什么..." dragonfly="true" onKeyUp="textarealength(this,100)">{$activity.activityDetail}</textarea>
                <p class="textarea-numberbar"></p>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-2">活动须知：</label>
            <div class="formControls col-xs-4 col-sm-5">
                <textarea name="actiivityNotice" cols="" rows="" class="textarea"  placeholder="说点什么..." dragonfly="true" onKeyUp="textarealength(this,100)">{$activity.actiivityNotice}</textarea>
                <p class="textarea-numberbar"></p>
            </div>
        </div> 
         <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">详细内容：</label>
            <div class="formControls col-xs-8 col-sm-9"> 
                <script id="editor" type="text/plain" style="width:100%;height:200px;"></script> 
            </div>
        </div>     
         <div class="row cl">
            <div class="col-xs-4 col-sm-5 col-xs-offset-4 col-sm-offset-2">
                <button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;返回列表&nbsp;&nbsp;</button>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <button  id="bt_sub" class="btn btn-primary radius" type="submit">&nbsp;&nbsp;创建&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="__PUB__/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__PUB__/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="__PUB__/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="__PUB__/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="__PUBLIC__/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="__PUBLIC__/h-ui.admin/js/H-ui.admin.page.js"></script> 
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<!-- <script type="text/javascript" charset="utf-8" src="__PUB__/neditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUB__/neditor.all.min.js"> </script> -->
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery.datePicker-min.js"></script>
<script  type="text/javascript" src="__PUBLIC__/codebase/GooFunc.js"></script>
<script  type="text/javascript" src="__PUBLIC__/codebase/GooCalendar.js"></script>
<script src="__PUB__/layer.min.js"></script>
<script type="text/javascript">
var property2={
    divId:"demo2",//日历控件最外层DIV的ID
    needTime:true,//是否需要显示精确到秒的时间选择器，即输出时间中是否需要精确到小时：分：秒 默认为FALSE可不填
    yearRange:[1970,2030],//可选年份的范围,数组第一个为开始年份，第二个为结束年份,如[1970,2030],可不填
    week:['日','一','二','三','四','五','六'],//数组，设定了周日至周六的显示格式,可不填
    month:['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],//数组，设定了12个月份的显示格式,可不填
    format:"yyyy-MM-dd hh:mm:ss"
    /*设定日期的输出格式,可不填*/
};
/*活动时间*/
$(document).ready(function(){
    $(".datepicker").datePicker({
        inline:true,
        selectMultiple:false
    });
     $(".datepick").datePicker({
        inline:true,
        selectMultiple:false
    });
    $("#datepicker").datePicker({
        clickInput:true
    });
     $("#datepick").datePicker({
         clickInput:true
    });
});
//活动截至时间
$(document).ready(function(){
//  canva1=$.createGooCalendar("calen",property);
    canva2=$.createGooCalendar("calen2",property2);
    //canva2.setDate({year:2008,month:11,day:22,hour:14,minute:52,second:45});
});
$(function(){
  var ue = UE.getEditor('editor');   
$('#file_img').change(function (){
    var file_img=$(this);
    var img = $('#goodsThums');
    if (file_img[0].files[0].type.indexOf("image") == -1) {
        file_img.val("");
        img.attr('src',"{{ asset('static/ic_ph.png') }}");
        layer.msg('请选择图片类型的文件!', {icon: 7, time: 1000});
    } else {
        var files = file_img[0].files[0];
        toBase64(files, function (res) {
            img.attr('src',res);
        })
    }
});
});
</script>
</body>
</html>